package com.ljh.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ljh.common.JsonData;
import com.ljh.pojo.Client;
import com.ljh.mapper.ClientMapper;
import com.ljh.service.CLIENTervice;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 刘剑鸿
 * @since 2021-10-25
 */
@Service
public class ClientServiceImpl extends ServiceImpl<ClientMapper, Client> implements CLIENTervice {

    @Autowired
    private ClientMapper clientMapper;

    public int addClient(Client client){
        return clientMapper.addClient(client);
    }

    public Client getClient(String clientname,String phoneNumber){
        QueryWrapper<Client> wrapper = new QueryWrapper<>();
        wrapper.eq("clientname",clientname);
        wrapper.eq("phone_number",phoneNumber);
        Client client = clientMapper.selectOne(wrapper);
        return client;
    }
}
